<%--
  Created by IntelliJ IDEA.
  User: 19416
  Date: 2022-10-02
  Time: 12:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
<%--    <base href="${pageContext.request.contextPath}">--%>
    <script src="JS/jquery-2.1.1.min.js"></script>
</head>

<body>
<form action="${pageContext.request.contextPath}/ResumeBySexServlet" align="center" method="get">
    <h1 align="center">个人简历信息列表</h1>
    性别：<input type="radio" name="sex" value="男">男
    <input type="radio" name="sex" value="女">女
    <input type="radio" name="sex"  value="全部">全部
    <input type="submit" value="查询">

</form>
<a href="${pageContext.request.contextPath}/resumeAdd.jsp">添加</a>

    <table align="center" border="1px">
         <tr>
             <td>姓名</td>
             <td>性别</td>
             <td>籍贯地址</td>
             <td>出生日期</td>
             <td>联系电话</td>
             <td>毕业学习</td>
             <td>简历状态</td>
             <td>操作</td>
         </tr>

        <c:forEach items="${requestScope.list}" var="resume">
            <td>${resume.userName}</td>
            <td>${resume.sex}</td>
            <td>${resume.address}</td>
            <td>${resume.birth}</td>
            <td>${resume.telephone}</td>
            <td>${resume.school}</td>
            <td>${resume.status}</td>
            <td><a href="#" onclick="Delete(${resume.id})">删除</a></td>

            </tr>
        </c:forEach>
    </table>
<script>
    function Delete(id) {
        if (confirm("确定要删除吗？")) {
            $.get("ResumeDeleteServlet",{"id": id},function (data) {
                if (data) {
                    alert("删除成功！")
                    location.reload()
                }
            });
        }
    }
</script>
</body>
</html>
